﻿using Microsoft.AspNetCore.Mvc;
using WMS_MAV.DTO.Ledger;

namespace WMS_MAV.Controllers
{
    public class LedgerInfoController : Controller
    {

        private readonly IConfiguration _configuration;
        public LedgerInfoController(IConfiguration configuration)
        {
            _configuration = configuration;
        }
        public IActionResult Index()
        {
            return View();
        }
        public IActionResult LedgerInfoView() { 
            return View();  
        }
        /// <summary>
        /// 报表台账
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<ActionResult> LedgerInfoShow(LedgerSelDto dto)
        {
            HttpClientWrapper client = new HttpClientWrapper(dto.Token);
            string url = _configuration["Url"] + "warehouseRead/api/Reportlosses/LedgerProduct?index=" + dto.index + "&size=" + dto.size + "&productNo=" + dto.ProductNo + "&productName=" + dto.ProductName + "&binLocationName=" + dto.BinLocationName + "&batch=" + dto.Batch;
            var respomse = await client.GetAsync(url);
            return Json(respomse);
        }
    }
}
